<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div><h1>首页</h1></div>
<div sec:authorize="!isAuthenticated() "><a th:href="@{/toLogin}">登录</a></div>
<div sec:authorize="isAuthenticated() ">用户名：<span sec:authentication="name"></span><span sec:authentication="principal.authorities"></span><a th:href="@{/logout}">注销</a> </div>
<div><a th:href="@{/add}">add</a></div>
<div><a th:href="@{/update}">update</a></div>
</body>
</html>